#include <bits/stdc++.h>

using namespace std;
using ll = long long;

const int N = 100 + 5;
int t, n;
int a;

int main() {
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    cin >> t;

    while (t--) {
        cin >> n;
        map<int, int> m;
        for (int i = 0; i < n; i++) {
            cin >> a;
            if (a < 0) a = -a;
            m[a]++;
        }

        int ans = 0;
        for (auto [k, v] : m) {
            if (v > 1 && k != 0) ans += 2;
            else ans += 1;
        }
        cout << ans << endl;
    }
    return 0;
}